package cn.edu.ren.dao;

import cn.edu.ren.pojo.Student;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * @PackageName: cn.edu.ren.dao
 * @ClassName: StudentDao
 * @Description:
 * @author: RZS
 * @date: 2021/5/19  9:44
 */
@Repository
public class StudentDaoImp implements IStudentDao {

    private static Map<Long, Student> studentMap;

    static {
        studentMap = new HashMap<>();
        studentMap.put(1L, new Student(1L, "张三", 22));
        studentMap.put(2L, new Student(2L, "李四", 23));
        studentMap.put(3L, new Student(3L, "王五", 24));
    }

    @Override
    public Collection<Student> findAll() {
        return studentMap.values();
    }


}
